/*
only export target_url and target_host interface is OK
mrselect should use mrget cargo directly





use std::collections::HashMap;
use url::{Url, UrlParser, SchemeType};
use cache::MemoryCache;


#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct UrlMirror {
    url: String,
    role: String,
    name: String,
    description: String,
    country_code: String,
    city_name: String,
    is_fallback_mirror: bool,
    is_partial_mirror: bool,
    is_readonly_mirror: bool,
    chroot: String,
    address_families: String,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct HostMirror {
    host: String,
    role: String,
    name: String,
    description: String,
    country_code: String,
    city_name: String,
    is_fallback_mirror: bool,
    is_partial_mirror: bool,
    is_readonly_mirror: bool,
    address_families: String,
}




extern "C" {
    fn target_urls() -> *mut FILE;
    fn target_hosts() -> *mut FILE;
}



typedef int (*url_mirror_filter)(const URL_MIRROR*, const URL_MIRROR*);
typedef int (*url_mirror_sorter)(const URL_MIRROR*, const URL_MIRROR*);

typedef int (*host_mirror_filter)(const HOST_MIRROR*, const HOST_MIRROR*);
typedef int (*host_mirror_sorter)(const HOST_MIRROR*, const HOST_MIRROR*);

char** target_urls(char *url, url_mirror_filter *filter, url_mirror_sorter *sorter, max_count);

char** target_hosts(char *url, host_mirror_filter *filter, host_mirror_sorter *sorter, max_count);

void free_urls(char **urls);




fn target_urls(url: &str, filter_key: Option<&str>, sort_key: Option<&str>, for_read: bool, max_count: isize, kwargs: HashMap<&str, &str>) {
    let url_obj = Url::parse(url).expect("Failed to parse the URL");
    if url_obj.scheme() != "mirror" {
        panic!("only accept mirror://");
    }

    MemoryCache::get_target_urls(url, url_obj, filter_key, sort_key, for_read, max_count, kwargs);
}

fn target_hosts(host: &str, filter_key: Option<&str>, sort_key: Option<&str>, for_read: bool, max_count: isize, kwargs: HashMap<&str, &str>) {
    MemoryCache::get_target_hosts(host, filter_key, sort_key, for_read, max_count, kwargs);
}
*/